package com.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.github.pagehelper.PageInfo;
import com.model.ReponseDto;
import com.service.IDataService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping(value = "/data")
@Api(tags = "数据管理", value = "数据管理相关api")
public class DataController {

    @Autowired
    private IDataService dataService;

    @RequestMapping(value = "/list")
    @ApiOperation(value = "数据列表")
    @ApiImplicitParams({ @ApiImplicitParam(name = "userName", value = "用户名", required = false),
            @ApiImplicitParam(name = "coinSymbol", value = "币种", required = false),
            @ApiImplicitParam(name = "pageNo", value = "pageNo", required = false),
            @ApiImplicitParam(name = "pageSize", value = "pageSize", required = false)})
    public ReponseDto<PageInfo> list(Model model, HttpServletRequest request, String userName, String coinSymbol,
            String pageNo, Integer pageSize) {
        return dataService.list(userName, coinSymbol, pageNo, pageSize);
    }
}
